//package com.xiaohong.test.interceptor;
//
//import feign.RequestInterceptor;
//import feign.RequestTemplate;
//import org.springframework.context.annotation.Configuration;
//
//@Configuration
//public class TokenRequestInterceptor implements RequestInterceptor {
//
//    public static String token;
//
//    @Override
//    public void apply(RequestTemplate template) {
//        /**
//         * 从数据库加载查询用户信息
//         * 1:没有令牌，Feign调用之前，生成令牌(admin)
//         * 2:Feign调用之前，令牌需要携带过去
//         * 3:Feign调用之前，令牌需要存放到Header文件中
//         * 4:请求->Feign调用->拦截器Request Interceptor->Feign调用之前执行拦截
//         */
//        //将令牌信息存放到请求头中
//        template.header("Authorization","bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJ3ZWIiXSwibmFtZSI6bnVsbCwiaWQiOm51bGwsImV4cCI6MTYwMzk2OTk0MCwiYWdlIjpudWxsLCJhdXRob3JpdGllcyI6WyJhZG1pbiJdLCJqdGkiOiIwNzlmNDkzMS0zMGVhLTQ4NzItYWNhYy02MTlkMWQzYjUyMWQiLCJjbGllbnRfaWQiOiJ4aWFvaG9uZyIsInVzZXJuYW1lIjoieGlhb2hvbmcifQ.T047iEVqXhUaVLX4Vvofvn1HYKzOs0P7stV9nnoIVM4RVonYKGAqGCuFrSKcwOP1mc-mF5shk7FTN1Qrw_xKedV3qIw6-9IC2ihX_yo1niZQlcjc7y_KXYoe6quXFj1flrQLmC0vv_ehbxteedl_uVyATff4ruFNfTeT2BGANm5oXN0TOYj9cIrQGKK1Tp69NPlxem22A4pK9HkqV5Q_r1gfpEOw5vy59-JBGtcDORzVXsnXEPor2uFTwD-ULt65rb3G4FOlXw9Zr5hitVtIZNKnEq9WzoGCYSqXLBlpMwBDodRotzBCJI3CPdg5OUa7eHM5dsk60rQD04aKiQnJGA");
//    }
//}
//
